|
.NET Framework | |||||||||
PREV TYPE NEXT TYPE | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONST | PROP | METHOD | OP | EVENT | DETAIL: FIELD | CONST | PROP | METHOD | OP | EVENT |
Address for a node
Field Summary | |
---|---|
Naanou.Common.BasicAddress | basicForm |
bool | cannotCreate |
int | deadTries |
Naanou.Common.Hash |
id
Node Id |
bool | isAlive |
long | lastAliveCheckTicks |
Naanou.Common.Hash |
network
Network node belongs too |
Naanou.LookupService.RemoteNode |
node
Remote instansiation of address |
string |
url
URL for node services. Will always have a trailing slash |
Constructor Summary | |
---|---|
NodeAddress(Naanou.Common.BasicAddress address) Constructor |
|
NodeAddress(Naanou.Common.BasicAddress address, Naanou.LookupService.RemoteNode node, bool cannotCreate) Constructor |
|
NodeAddress(Naanou.Common.Hash id, string url, Naanou.Common.Hash network) Constructor |
|
NodeAddress(Naanou.Common.Hash id, string url, Naanou.Common.Hash network, Naanou.LookupService.RemoteNode node) Constructor |
Property Summary | |
---|---|
Naanou.Common.Hash |
Id
Gets the Id |
bool |
IsEmpty
Is the address unset |
Naanou.Common.Hash |
Network
Gets Network |
Naanou.LookupService.RemoteNode |
Node
Attempts to instansiate the remote object at this address, or returns a existing instance |
string |
Url
Gets Url of address |
Method Summary | |
---|---|
bool |
CheckAlive() Checks whether a node is alive or not. |
Naanou.LookupService.NodeAddress |
Clone(Naanou.LookupService.NodeAddress address) Creates a shallow-clone of address. Used for making a local version of a address proxy |
void |
Dispose() Cleans up address |
bool |
Equals(Naanou.Common.Address address) Does this address equal another? |
bool |
Equals(Naanou.LookupService.NodeAddress address) Does this address equal another? |
int |
IncrementDeadTries() Increments dead tries |
bool |
IsAlive() Keeps rough track of whether a node is alive or not. Automatically requeries node when required. |
double |
Ping() Pings an address. (blocking) |
void |
ResetAliveTicks() Resets aliveness |
void |
SetAlive(bool alive) Manual override for 'aliveness' |
void |
SetCannotCreate(bool cannotCreate) If set to true, no new instance of a RemoteNode for this address will ever be created |
void |
SetNetwork(Naanou.Common.Hash network) Manually sets the network id of an address |
void |
SetNode(Naanou.LookupService.RemoteNode node) Manually set the RemoteNode instance for this address |
void |
SetUrl(string url) Manually sets the url. |
Naanou.Common.BasicAddress |
ToBasic() Gets the basic form of the address |
string |
ToString() Returns a string representation of this object |
Methods inherited from class System.MarshalByRefObject |
---|
CreateObjRef, GetLifetimeService, InitializeLifetimeService |
Methods inherited from class System.Object |
---|
Equals, Finalize, GetHashCode, GetType, MemberwiseClone |
Field Detail |
---|
private Naanou.Common.BasicAddress basicForm
private bool cannotCreate
private int deadTries
private Naanou.Common.Hash id
Node Id
private bool isAlive
private long lastAliveCheckTicks
private Naanou.Common.Hash network
Network node belongs too
private Naanou.LookupService.RemoteNode node
Remote instansiation of address
private string url
URL for node services. Will always have a trailing slash
Constructor Detail |
---|
public NodeAddress(Naanou.Common.BasicAddress address)
Constructor
Parameters:
address
- Basic address to base frompublic NodeAddress(Naanou.Common.BasicAddress address, Naanou.LookupService.RemoteNode node, bool cannotCreate)
Constructor
Parameters:
address
- BasicAddressnode
- RemoteNode isntancecannotCreate
- Sets cannotCreate flagpublic NodeAddress(Naanou.Common.Hash id, string url, Naanou.Common.Hash network)
Constructor
Parameters:
id
- Idurl
- Urlnetwork
- Network idpublic NodeAddress(Naanou.Common.Hash id, string url, Naanou.Common.Hash network, Naanou.LookupService.RemoteNode node)
Constructor
Parameters:
id
- Node idurl
- Services URLnetwork
- Network idnode
- Existing RemoteNode instance to useProperty Detail |
---|
public Naanou.Common.Hash Id
Gets the Id
public bool IsEmpty
Is the address unset
public Naanou.Common.Hash Network
Gets Network
public Naanou.LookupService.RemoteNode Node
Attempts to instansiate the remote object at this address, or returns a existing instance
Throws:
System.InvalidOperationException
- Thrown for addresses that cannot be instansiatedNaanou.LookupService.NodeCommunicationException
- Thrown when we can't talk to nodepublic string Url
Gets Url of address
Method Detail |
---|
public bool CheckAlive()
Checks whether a node is alive or not.
Returns:
public Naanou.LookupService.NodeAddress Clone(Naanou.LookupService.NodeAddress address)
Creates a shallow-clone of address. Used for making a local version of a address proxy
Parameters:
address
- Address to clonepublic void Dispose()
Cleans up address
public bool Equals(Naanou.Common.Address address)
Does this address equal another?
Parameters:
address
- Address to checkpublic bool Equals(Naanou.LookupService.NodeAddress address)
Does this address equal another?
Parameters:
address
- Address to checkpublic int IncrementDeadTries()
Increments dead tries
Returns:
public bool IsAlive()
Keeps rough track of whether a node is alive or not. Automatically requeries node when required.
Returns:
public double Ping()
Pings an address. (blocking)
Pings an address 5 times and returns the average
Returns:Naanou.LookupService.NodeCommunicationException
- When node cannot be contactedprivate void ResetAliveTicks()
Resets aliveness
internal void SetAlive(bool alive)
Manual override for 'aliveness'
Parameters:
alive
- Aliveinternal void SetCannotCreate(bool cannotCreate)
If set to true, no new instance of a RemoteNode for this address will ever be created
Parameters:
cannotCreate
- internal void SetNetwork(Naanou.Common.Hash network)
Manually sets the network id of an address
Parameters:
network
- Networkinternal void SetNode(Naanou.LookupService.RemoteNode node)
Manually set the RemoteNode instance for this address
Parameters:
node
- Nodeinternal void SetUrl(string url)
Manually sets the url.
Parameters:
url
- Urlpublic Naanou.Common.BasicAddress ToBasic()
Gets the basic form of the address
Returns:
public string ToString()
Returns a string representation of this object
Returns:
|
.NET Framework | |||||||||
PREV TYPE NEXT TYPE | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONST | PROP | METHOD | OP | EVENT | DETAIL: FIELD | CONST | PROP | METHOD | OP | EVENT |